package forms

type UserForm struct {
	Name       string `json:"name" form:"name"`
	Avatar     string `json:"avatar" form:"avatar"`
	Account    string `json:"account" form:"account" binding:"required"`
	Password   string `json:"password" form:"password" binding:"required"`
	Role       int    `json:"role" form:"role" binding:"required,oneof=1 2 99"`
	IsDisabled bool   `json:"is_disabled" form:"is_disabled"`
}

type LoginUserForm struct {
	Account  string `json:"account" form:"account" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type GetUserForm struct {
	GetListForm
	Name    string `json:"name" form:"name"`
	Account string `json:"account" form:"account"`
}

type AdminEditUserForm struct {
	ID       int32  `json:"id" form:"id" binding:"required"`
	Password string `json:"password" form:"password"`
	Account  string `json:"account" form:"account"`
	EditUserForm
}

type EditUserForm struct {
	Name   string `json:"name" form:"name"`
	Avatar string `json:"avatar" form:"avatar"`
	Role   int    `json:"role" form:"role" binding:"oneof=1 2 99"`
}

type ChangePwdForm struct {
	OldPassword string `json:"old_password" form:"old_password" binding:"required"`
	NewPassword string `json:"new_password" form:"new_password" binding:"required"`
	ReqPassword string `json:"req_password" form:"req_password" binding:"required,eqfield=NewPassword"`
}

type AdminChangePwdForm struct {
	ID int32 `json:"id" form:"id" binding:"required"`
}

type DisableUserForm struct {
	ID      int32 `json:"id" form:"id" binding:"required"`
	Disable *bool `json:"disable" form:"disable" binding:"required"`
}
